package gob.osinerg.emergencia.tag;

import org.apache.commons.lang.StringUtils;

public class MonthFieldControl extends GenericControl{
	
	public MonthFieldControl() {
		setType("text");
		setControl("input");
		setOnkeypress("javascript:return esTeclaNumero(this)");
		setOnkeyup("javascript:return maxThan(this,11)");
	}
	
	public String toString() {
		StringBuffer sb = new StringBuffer();
		sb.append("<td width=\"25%\" height=\"25\" style=\"padding-bottom: 10px\"> ");
		sb.append(StringUtils.isEmpty(getLabel())?"":getLabel()+" ");
		sb.append("</td>");
		sb.append("<td>");
		openTag(sb);
		sb = getHtml(sb);
		closeTag(sb);
		sb.append(StringUtils.isEmpty(getRequired())?"":"(*)");
		sb.append("</td>");
		return sb.toString();
	}

}
